#define _CRT_SECURE_NO_WARNINGS 1
#include "SList.h"

void test()
{
    SLTNode* plist = NULL;
    SListPopBack(&plist);

    SListPushFront(&plist, 10);
    SListPopBack(&plist);


    SListPushBack(&plist, 1);
    SListPushBack(&plist, 2);
    SListPushBack(&plist, 3);
    SListPushFront(&plist, 20);

    SListPushFront(&plist, 50);
    SListPushBack(&plist, 4);
    SListPushBack(&plist, 4);
    SListPopBack(&plist);
    SListPrint(&plist);
}

void test1()
{
    SLTNode* plist = NULL;
    SListPushBack(&plist, 1);

    SLTNode* pos = SListFind(&plist, 1);
    if (pos != NULL)
    {
        SListInsert(&plist, pos, 20);
    }
    /*SListPopFront(&plist);
    SListPushBack(&plist, 2);
    SListPushBack(&plist, 3);
    SListPushBack(&plist, 4);
    SListPushBack(&plist, 10);

    SLTNode* pos = SListFind(&plist, 4);
    if (pos != NULL)
    {
        SListInsert(&plist, pos, 20);
    }*/
    SListPrint(&plist);

}

void test2()
{
    SLTNode* plist = NULL;
    SListPushBack(&plist, 2);
    SLTNode* pos = SListFind(&plist, 2);
    if (pos != NULL)
    {
        SListErase(&plist, pos);
    }
    SListPrint(&plist);
}
int main()
{ 
    test2();
    system("pause");
}